Physical layer
Data link layer (or network interface, or network access layer)
Network layer (or internet layer)
Transport layer
Application layer:

Analogy: the physical layer is the delivery truck and the roads; the data link layer is how the delivery trucks get from one intersection to the next; the network layer identifies which roads need to be taken to get from address A to address B; the transport layer ensures that delivery driver knows how to knock on your door to tell you your package has arrived; the application layer is the contents of the package itself.

Copper cables:
Fiber (or fiber optic cables):
Used to connect devices on the same network (LAN, or local area network).

Hub is a physical layer device that allows for connections from many computers at once.
Network switch is a data link layer device that allows for connection from many computers at once.
Used to connect devices on different networks.

Router is a network layer device that allows to forward data between independent networks.
Client is something that requests data.
Server is something that provides data to a client.

The physical layer consists of devices and means of transmitting bits across computer networks. A standard copper network cable will carry a constant electrical charge and binary is encoded through modulation, or line coding.

The most common connection type used in computer networking is known as twisted pair (pairs of copper wires that are twisted together). These pairs act as a single conduit for information, and their twisted nature protects signal against electromagnetic interference and crosstalk from neighboring pairs.
Cat6 cable has eight wires consisting of four twisted pairs inside a single jacket. Exactly how many pairs are in use depends on the transmission technology being used.

Simplex communication: information can flow only unidirectionally across the cable.
Duplex communication: information can flow in both directions across the cable (e.g., phone call).

To ensure duplex communication networking cables reserve one or two pairs for communicating in one direction, and the other one or two pairs in another direction.
Ethernet over twisted pair technologies are the communication protocols that determine the volume of data that can be transfered, transfer rate and the distance at which quality of this data begins to degrade.
Twisted pair network cables are terminated with a plug that takes the individual internal wires and exposes them. The most common plug: RJ-45 (registered jack 45).
A network cable with an RJ-45 plug can connect to an RJ-45 network port. Network ports are generally directly attached to the devices. Switches have many network ports (because their purpose is to connect many device), while servers and desktops usually only have one or two.
Most network ports have two LEDs: link light and activity light. The link light is lit when devices are connected and powered on, and the activity light is lit when data is actively transmitted. On switches, sometimes the same LED is used for both link and activity status (it also might indicate other things like link speed).

Sometimes a network port isn't connected directly to a device, but instead, there might be network ports mounted in a wall or underneath a desk. These ports are generally connected to the network via cables ran through the walls that eventually end at a patch panel (device that contains many net ports but does no other work).
Patch panel is just a container for the endpoints of many runs of cable. Additional cables are then generally ran from a patch panel to switches or routers to provide a network access.

Wireless and cellular internet access are becoming some of the most common ways to connect to networks, but traditional cable networks are still the most common option. Ethernet is the most widely used protocol to send data across individual links.
MAC address is globally unique identifier attached to an individual network interface.
Ethernet uses MAC addresses to ensure that sent data has an address for the machine that sent it and for the machine it was intended for
MAC address is a 6-byte (48-bit) number:
A MAC address is split into two sections:

Unicast: transmission is meant just for one address.
Multicast: transmission is meant for several addresses.
Unicast and multicast frames are sent to all devices on the collision domain. The difference: unicast frame is only received and processed by the intended destination, while multicast frame will be accepted or discarded by devices depending on criteria aside from their MAC addresses (network interfaces can be configured to accept lists of multicast addresses).
Broadcast: transmission is meant for every device on a LAN.
Accomplished by using a special destination known as a broadcast address (FF:FF:FF:FF:FF:FF). Ethernet broadcasts are used so that devices can learn more about each other.

Data in computer networks is sent by packets. The term data packet isn't tied to any specific layer or technology, it just represents a concept. At Ethernet level data packets are called Ethernet frames.

Preamble (8 bytes)
Destination and source MAC addresses (12 bytes)
VLAN tag (4 bytes; optional)
EtherType (2 bytes)
Payload (46-1500 bytes)
FCS (frame check sequence) (4 bytes)
Physical layer is responsible for transfering data over short distances on a single segment of LAN. Network layer allows to transfer data over greater distances across many networks.
The MAC addressing scheme works well on a LAN (because switches can quickly learn about MAC addresses in use), but it fails to scale well. Since MAC addresses are unique and not ordered in any systematic way, there is no way of knowing where on the planet a certain MAC address might be. Solution for this problem is found in the network layer and IP (internet protocol).
IP address is a number assigned to each device connected to a computer network.
123.45.67.89 is an IP address (dotted decimal notation)| Dynamic IP address | Static IP address |
|---|---|
| automatically assigned by a network (usually reserved for clients) | manually configured on a node (usually reserved for servers and network devices) |
Under the IP protocol packets are called IP datagrams. Each IP datagram consists of two parts: header and payload.

Version of IP (4 bits)
Header length (4 bits)
Service type (8 bits)
Total length (16 bits)
Identification (16 bits)
Flags (3 bits)
Fragmentation offset (13 bits)
TTL (time to live) (8 bits)
Protocol (8 bits)
Header checksum (16 bits)
Source and destination IP addresses (64 bits)
IP options (optional)
Padding
Payload
The entire contents of an IP datagram are encapsulated as the payload of an Ethernet frame. At the same time the payload of the IP datagram contains datagram from the transport layer, and so on. This process is known as encapsulation.

IP addresses can be split into two sections: the network ID and the host ID. There are three primary types of address classes: A, B, and C (1:3, 2:2, 3:1).
0: class A, 10: class B, 110: class C, 1110: class D.
ARP is a protocol that's used to discover MAC addresses of nodes from IP addresses.
ARP table is a list of associated IP and MAC addresses.
Once an IP datagram has been formed, it needs to be encapsulated inside an Ethernet frame. To do this the transmitting device needs to know a destination MAC address.

FF:FF:FF:FF:FF:FF), which is delivered to all computers on the LAN.Subnetting is process of splitting a large network into many subnets (which will have their own gateway routers serving as the ingress and egress points).
Subnet mask is 32-bit number (4 octets) of the following form: 1...10...0.
Subnetting is implemented using subnet masks. They add subnet ID to the IP address and extend what's possible with just network IDs and host IDs (and CIDR allows even more flexibility).

The size of a subnet is entirely defined by its subnet mask (in general, a subnet can usually only contain two less than the total number of host IDs available: 0 is generally not used and 255 is normally reserved as a broadcast address).
For convenience subnet masks are sometimes abbreviated in the following way (CIDR notation):

Address classes and traditional subnetting weren't the most efficient way of organizing IP addresses. The sizing of networks was inpractical: 254 hosts for class C networks, but 65534 hosts for class B, and no option in between (so many companies ended up adjoining several class C networks together).

CIDR (classless inter-domain routing) is a more flexible approach to this problem. With CIDR, the network ID and subnet ID are combined into one, so CIDR abandons the concept of address classes entirely.
CIDR:
allows for more arbitrary network sizes
simplifies how routers and other network devices think about parts of an IP address and helps with IP address management (e.g instead of adjoining several networks companies just combine their address space into one network with an appropriate subnet mask)
gives additional available host IDs:
Two /24 networks: 2 ∙ (28 - 2) = 2 ∙ 254 = 508 hosts
One /23 network: 29 - 2 = 510 hosts
Router is a network device that forwards traffic depending on the destination address of that traffic.

Basic routing:
Routing tables can vary a lot, but the most basic one will have four columns:
Destination network
A row for each network that the router knows about (a network ID, and the subnet mask) and a catchall entry for any IP address that it doesn't have an explicit network listing for.
Next hop
IP address of the next router that should receive data intended for the destination network (if additional hops are needed).
Total hops
How far away the destination currently is (this information is constantly updated from neighboring routers for optimal routing).
Interface
Which of routers interfaces should be used.
Routing tables are always updated with new information about the quickest paths to destination networks. This is done with the help of routing protocols: interior gateway protocols and exterior gateway protocol.
Interior gateway protocols
Used by routers to share information within a single autonomous system (collection of networks under the control of a single network operator).
Distance vector protocols
Link state protocols
Exterior gateway protocol
Used to communicate data between routers representing the edges of autonomous systems. Each autonomous system has a 32-bit numbers assigned to it called ASN (autonomous system number) (normally referred to as a single decimal number). These numbers just as IP addresses are allocated by the IANA (internet assigned numbers authority).
There is only one exterior gateway protocol in use today: BGP (border gateway protocol).
From the early days of the Internet it was clear that the available number of IPv4 addresses is too small, so in 1996 RFC1918 was published (request for comments). It outlined a number of networks that would be defined as non-routable address space: ranges of IPs set aside for use by anyone that cannot be routed to.
10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.The transport layer allows traffic to be directed to specific network applications and the application layer allows these applications to communicate with each other. The transport layer is responsible for multiplexing and demultiplexing traffic, establishing long running connections and ensuring data integrity through error checking and data verification.
Multiplexing: nodes on the network have the ability to direct traffic toward many different receiving services.
Demultiplexing: taking traffic that's all aimed at the same node and delivering it to the proper receiving service.

10.1.1.100:80. When written this way, it's known as a socket address (or socket number). Just like how an Ethernet frame encapsulates an IP datagram, an IP datagram encapsulates a TCP segment (TCP header + data section for application layer).

Source and destination ports (32 bits)
Sequence number (32 bits)
Acknowledgment number (32 bits)
Header length (4 bits)
Control flags (6 bits)
Window (16 bits)
Checksum (16 bits)
Urgent (16 bits)
Options (optional)
Padding
Payload
TCP establishes connections through the use of TCP control flags (6 bits):
URG (urgent)
If segment is considered urgent and that the urgent pointer field has more data about this.
ACK (acknowledge)
If the acknowledgment number field should be examined.
PSH (push)
If the transmitting device wants the receiving device to push currently buffered data to the application on the receiving end as soon as possible (used to send large chunks of data more efficiently).
RST (reset)
If one of the sides in a TCP connection hasn't been able to properly recover from a series of missing or malformed segments, so the connection needs to be reestablished.
SYN (synchronize)
Used when first establishing a TCP connection.
FIN (finish)
If the transmitting computer doesn't have any more data to send and the connection can be closed.
Three-way handshake (establishing the connection):

Four-way handshake (closing the connection):

TCP socket is an endpoint instance of a specific TCP connection or listening state defined by an IP address and a port.
TCP sockets can exist in lots of states:
LISTEN
Socket is ready and listening for incoming connections (servers only).
SYN_SENT
Synchronization request has been sent, but the connection hasn't been established yet (clients only).
SYN_RECEIVED
Socket, which was in a LISTEN state, has received a synchronization request and sent a SYN/ACK back. But it hasn't received the final ACK from the client yet (servers only).
ESTABLISHED
TCP connection is in working order, and both sides are free to send each other data (clients and servers).
FIN_WAIT
FIN has been sent, but the corresponding ACK from the other end hasn't been received yet.
CLOSE_WAIT
The connection has been closed at the TCP layer, but the application that opened the socket hasn't released its hold on the socket yet.
CLOSED
The connection has been fully terminated.
There are other socket states that exist. Additionally, their names can vary depending on an OS (they exist outside of the scope of the definition of TCP itself).
Connection-oriented protocol is a protocol that establishes a connection and uses it to ensure that all data is properly transmitted with the help of acknowledgments (e.g., TCP).
There's a lot of extra traffic with connection-oriented protocols: establishing connections, sending a constant streams of acknowledgements, tearing the connection down at the end. But sometimes you don't need to know that every packet you send reaches its destination (e.g., when streaming video).
Connectionless protocol is a protocol that doesn't rely on acknowledgements and establishment of connections (e.g., UDP, or user datagram protocol).
The range that ports can occupy (0-65535) is split into independent sections:
Port 0
Not used for network traffic, but sometimes used in communications between different programs on the same computer.
System ports (1-1023)
Official ports for most well-known network services (registered with the IANA). Administrator-level access is needed to start a program that listens on a system port.
Registered ports (1024-49151)
Used for all the other network services (can be registered with the IANA). Any user can start a program listening on a registered port.
Ephemeral, or private, ports (49152-65535)
Used for establishing outbound connections: when a client wants to communicate with a server, the client will be assigned an ephemeral port (can't be registered with the IANA). Not all operating systems follow the recommendations of the IANA, so this range can vary.
Firewall is a device that blocks traffic that meets certain criteria.

There are a lot of protocols used at the application layer, but many of them are standardized across application types (e.g., web servers don't care what browser do you use as long as they use the same protocol).
OSI model is the most rigorously defined model, it has seven layers, where the application layer is divided into three parts:
Session layer
Presentation layer
Application layer

User at computer 1 opens up a web browser and enters 172.16.1.100 into the address bar. The web browser communicates with the local networking stack (part of the OS), explains that it wants to establish a TCP connection with 172.16.1.100:80. The networking stack will now examine its own subnet: it sees that 172.16.1.100 lives on another network, so data has to be sent to gateway router at 10.1.1.1.

Computer 1 looks at its ARP table to determine the MAC address of 10.1.1.1, but it doesn't find it. So it sends an ARP request for that IP address, which is broadcasted to FF:FF:FF:FF:FF:FF (to every node on the LAN).

Router A receives this ARP message and responds to computer 1 with its MAC address of 00:11:22:33:44:55. Computer 1 receives this response and now knows the hardware address of its gateway. It's ready to start constructing the outbound packet.

Computer 1 asked by the web browser to form an outbound TCP connection, so the OS identifies the available ephemeral port of 50000 and opens a socket connecting the web browser to this port.

Web browser needs to establish a TCP connection, so the networking stack starts to build a TCP segment. It fills in all the appropriate fields in the header: a source port of 50000, a destination port of 80, a sequence number, the SYN flag, and a checksum for the segment.

TCP segment is now passed along to the IP layer of the networking stack. This layer constructs an IP header: the source IP, the destination IP, a TTL of 64 (standard value), etc. Next, the TCP segment is inserted as the data payload for the IP datagram, and a checksum is calculated.

Now an Ethernet frame is constructed. All the relevant fields are filled in: the source and destination MAC addresses, etc. Finally, the IP datagram is inserted as the data payload and another checksum is calculated. Now the Ethernet frame is ready to be sent across the physical layer.

The network interface connected to computer 1 sends this binary data as modulations of the voltage of an electrical current running across a Cat6 cable that's connected between it and a network switch. This switch receives the frame, inspects the destination MAC address, and forwards the frame to the destination.

Router A receives the frame, calculates a checksum and compares it to the appropriate field in the header of the Ethernet frame.

Router A strips away the Ethernet frame and performs a checksum calculation on IP datagram. If all is correct router A inspects the destination IP address and performs a lookup of this destination in the routing table. Router A sees that the quickest path to destination is one hop away through Router B, which has an IP of 192.168.1.1. Next, router A makes a new IP datagram: takes old payload section, decrements the TTL by 1 and calculates a new checksum.

Next router A looks in its ARP table for 192.168.1.1 to get router B's MAC address. When found router A constructs an Ethernet frame with the MAC address of its interface on network B as the source and the MAC address of router B's interface on network B as the destination. Once the values for all fields in this frame have been filled out, router A places the newly constructed IP datagram into the data payload field, calculates a checksum, and places it into the frame header.
The frame makes it across network B, and is received by router B, where all the same checks are performed. Next, router B removes the the Ethernet frame encapsulation, and performs a checksum against the IP datagram. It then examines the destination IP address, looks at its routing table and sees that the computer 2 is on LAN (172.16.1.100). So it decrements the TTL by 1 again, calculates a new checksum, and creates a new IP datagram. This new IP datagram is again encapsulated by a new Ethernet frame, with the source and destination MAC address of router B and computer 2. And the whole process is repeated one last time.

The frame makes it across the network C to the computer 2 (a switch ensures it gets to the destination). Computer 2 strips away the Ethernet frame, performs a CRC and recognizes that the data has been delivered intact. It then examines the destination IP address and recognizes that as its own. Next, computer 2 strips away the IP datagram and examines the checksum for TCP segment. Then the destination port is examined, the networking stack on computer 2 ensures that there's an open socket on port 80: it's in the LISTEN state and held open by a running Apache web server. Computer 2 then sees that this packet has the SYN flag set, so it examines the sequence number and stores it, since it'll need to put it in the acknowledgement field once it crafts the response.

So a single TCP segment containing a SYN flag has been delivered. Next computer 2 needs to send a SYN-ACK response to computer 1, which then needs to be acknowledged by computer 1.
DNS (domain name system) is a global and highly distributed network service that resolves strings of letters into IP addresses.
Name resolution is process of using DNS to turn a domain name into an IP address.
There are five primary types of DNS servers (one DNS server can fulfill many of these roles at once):
Caching name servers
Recursive name servers
Root name servers
TLD name servers (top level domain)
Authoritative name servers.

This complicated hierarchical system for DNS resolutions controlled by trusted entities exists to protect users and to ensure that their traffic isn't being redirected by malicious parties.
DNS resolutions can generate a lot of traffic, so it's better to use connectionless protocols for this (like UDP).
DNS lookup via TCP
Total: 3 + 2 + 11 + 11 + 11 + 6 = 44 packets.
DNS lookup via UDP
Total: 1 + 2 + 2 + 2 + 1 = 8 packets.
If DNS resolver doesn't get a response via UDP it just asks again, i.e., error recovery functionality of TCP at the transport layer is provided by DNS at the application layer.
DNS over TCP is used when DNS lookup response can't fit in a single UDP datagram, in this case a name server would respond with a packet explaining that the response is too large and a TCP connection needs to be established.
DNS in practice operates with a set of defined resource record types, which allow for different kinds of DNS resolutions to take place. The most basic ones are:
A record
Quad A record (AAAA)
CNAME record (canonical name)
MX record (mail exchange)
SRV record (service)
TXT record (text)
There are lots of other DNS resource record types in common use like the NS records or SOA records which are used to define authority information about DNS zones.
Any domain name has three primary parts: TLD, domain and subdomain. When you combine all of them together, you get FQDN (fully qualified domain name).
TLD (top level domain)
.com, .net, .edu, country specific TLDs, .museum, .pizza, etc.)Domain
Subdomain
Every DNS server is responsible for a specific DNS zone, e.g., root name servers are responsible for root zones, TLD name servers for zones covering specific TLDs, and authoritative name servers for even finer-grained zones underneath that.
DNS zones have a hierarchical structure.
DNS zones don't overlap, e.g., TLD name server for the .com doesn't encompass every possible domain with that TLD (they are managed by appropriate authoritative name servers).
DNS zones allow for easier control over multiple levels of a domain: as the number of resource records in a single domain increases, it becomes harder to manage them, so network administrators split up their configurations into multiple zones.
Example: for a large company with offices in Los Angeles, Paris and Shanghai it's more convenient to split up company domain largecompany.com into DNS zones: la.largecompany.com, pa.largecompany.com, and sh.largecompany.com. So four authoritative name servers would be required for the setup.
DNS zones are configured through zone files (configuration files that declare all resource records for a particular zone). A zone file contains an SOA (start of authority) resource record declaration which declares the DNS zone and the name of the name server that is authoritative for it. Zone file also has NS records which indicate other name servers that may also be responsible for this zone.
It's common to have multiple physical DNS servers with their own FQDNs and IP addresses for a single DNS zone (for backup reasons).
Just like how subdomains can go many layers deep, DNS zones can be configured to do this too.
Reverse lookup zone files let DNS resolvers get FQDN from an IP. These files are the same as zone files except, instead of A records and quad A records, which resolve names to IPs, you'll find mostly pointer resource record declarations (resolves IP to a name).
Configuring hosts on a network can be very time consuming enterprise (every node needs an IP address, a subnet mask, a primary gateway, and a name server). To automate these tasks DHCP is used.
DHCP (dynamic host configuration protocol) is an application layer protocol that automates the configuration process for hosts on a network.
There are a few ways that DHCP can operate:
Dynamic allocation
Automatic allocation
Fixed allocation
DHCP can be used for many other things and not only for automatic network configuration: e.g., for assigning NTP (network time protocol) servers, which are used for network time synchronization.
The process by which a client gets network configuration information from a DHCP server is known as DHCP discovery.

DHCP DISCOVER
0.0.0.0:68 to 255:255:255:255:67DHCP OFFER
255.255.255.255:68DHCP REQUEST
0.0.0.0:68 to 255.255.255.255:67 requesting for an IP address assignmentDHCP ACK
255.255.255.255:68This configuration process is known as DHCP lease as it includes an expiration time (usually days or shorter). Once a lease has expired, a client would need to negotiate a new lease by performing the entire DHCP discovery process all over again. A client can also release its lease to the DHCP server when disconnecting from the network (this would allow the DHCP server to return client IP address to its pool of available IPs).
NAT (network address translation) is technology that allows a gateway to rewrite the source IP of an outgoing IP datagram, while retaining the original IP in order to rewrite it into the response.

Port preservation

Port forwarding

The IANA has been in charge of distributing IP addresses since 1988. Since that time the Internet has expanded and all 4.2 billion IPv4 addresses have been taken.
IANA has primarily been responsible for assigning address blocks to the five RIRs (regional internet registries): AFRINIC (Africa), ARIN (US, Canada and parts of the Caribbean), APNIC (most of Asia, Australia, New Zealand and Pacific Island nations), LACNIC (Central and South America, parts of the Caribbean), and RIPE (Europe, Russia, Middle East and parts of Central Asia).
IPv6 will eventually resolve the problem of address exhaustion, but implementing IPv6 worldwide is going to take some time. So for now NAT and non-routable address spaces are used as workaround. With NAT you can have thousands of machines use non-routable address space, but have a single public IP, while still sending and receiving traffic from the Internet.
Businesses use lots of different technologies to keep their networks secure: firewalls, NAT, non-routable address space, etc. But sometimes employees need to access a network from outside (work from home, business trips, etc.). To achieve this goal VPNs are used.
VPN (virtual private network) is technology that allows for the extension of a private or local network to a remote host that's not on this network.

Proxy service is a server that acts on behalf of a client in order to access another service.
There are many examples of proxies, but most common ones are:
Web proxy

Reverse proxy

Technologies that connect devices to the Internet are as different and diverse as these devices themselves.

For years before Ethernet, TCP or IP were ever invented, there were computer networks made up of technologies focused on connecting devices within close physical proximity to each other. But in 1970s people realized that PSTN (public switched telephone network), or POTS (plain old telephone service), can be used for long distance computer networking. The first system that implemented this idea was Usenet (precursor to the dial-up).
300 bps in the 1970s and 14.4 kbps in the early 1990s
Broadband is any connectivity technology that isn't dial-up.
Most common broadband solutions are:
T-Carrier technologies
64 kbps transfer rate, giving a single T1 line cable ability to transmit data at 1.5 Mbps.44.7 Mbps transfer rates (by multiplexing 28 T1 cables acting as a single link).DSL (digital subscriber lines)
In the early days of the Internet research showed that telephone lines were capable of transmitting way more data than what was needed for voice calls. Just like dial-up, DSL used POTS infrastructure, but in a more effective way by operating at a frequency range that didn't interfere with normal phone calls.
DLS connection was able to send much more data than dial-up (1.5 Mbps), and allowed for normal voice phone calls and data transfer to occur at the same time on the same line.
Data is transfered trough DSLAMs (DSL access multiplexers), which establish connections across phone lines (but unlike dial-up these connections are long-running, i.e., they aren't torn down until the DSLAM is powered off).
Most common types of DSL were:
ADSL (asymmetric DSL)
SDSL (symmetric DSL)
HDSL (high bit-rate DSL)
1.5 MbpsCable broadband

Fiber connections
Fiber provides higher speeds and allows transmissions to travel much further without degrading, but producing and laying fiber is a lot more expensive than using copper cables.
Instead of a modem, the demarcation point for fiber technologies is an ONT (optical network terminator), which converts data from protocols the fiber network can understand to those that twisted pair copper networks can.
FTTX (fiber to the X):
FTTN (fiber to the neighbourhood)
data is delivered to a single physical cabinet that serves a certain amount of the population (from this cabinet twisted pair copper or coax might be used for the last length of distance)
FTTB (fiber to the building, business, or basement)
data is delivered to an individual building (after that twisted pair copper is typically used)
FTTH (fiber to the home)
data is delivered to individual residents
Often you might want to connect multiple local networks that are physically separated from one another into one large network (e.g., offices of one company, that are located in different cities). WANs and point-to-point VPNs are used for this purpose.
WAN (wide area network)

Point-to-Point VPN
Today fewer and fewer devices are weighed down by physical cables in order to connect to computer networks. Many devices now can use wireless networking.
802.11b, 802.11a, 802.11g, 802.11n, and 802.11ac)2.4 GHz and 5 GHz frequency bands (5 GHz networks are faster and more reliable, but have shorter range)802.11 standards generally use the same data link protocol, but vary in how they operate on the physical layer (different frequency bands, modulation techniques, transmission bit rates, etc.)802.11 data frame:

Control field (16 bits)
802.11, etc.)Duration field (16 bits)
Source and destination MAC addresses (96 bits)
Receiving MAC address (48 bits)
Sequence control (16 bits)
Transmitter MAC address (48 bits)
Payload
Frame check sequence (32 bits)
There are a few main ways in which a wireless network can be configured:
Ad-hoc network
the simplest one: no supporting network infrastructure
every device communicates directly with every other device within range, and all nodes help pass along messages
some practical applications:

WLAN

Mesh network

Wireless networks don't have cables, so collision domains are inevitable (there is no network switches). Channels help fix this problem to a certain extent.
Channel is an individual, smaller section of the overall frequency band used by a wireless network.
2.4 GHz have a number of channels, each with a certain width802.11b network).
Wired networking has a certain amount of inherent privacy. That's not true for wireless communications, anyone within a certain range could intercept radio transmissions. That's why encryption is so important for wireless networks.
There are few standard solutions:
WEP (wired equivalent privacy)
WPA (Wi-Fi protected access)
WPA2
MAC filtering
Another popular form of wireless networking is cellular networking, or mobile networking. In some places cellular networks are the most common way of connecting to the Internet.

Many of the protocols and network devices have built-in functionalities to help protect against networking failures and errors (e.g., misconfigurations, hardware problems, and system incompatibilities).
Error-detection is ability for a protocol or a program to determine that something went wrong (e.g., CRC).
Error-recovery is ability for a protocol or a program to attempt to fix the issue (e.g., TCP connection establishing).
The inability to establish a connection to something is the most common networking issue. When a network error occurs, the device that detects the issue will communicate it to the source of the problematic traffic using ICMP (internet control message protocol). Frequently occuring errors: router doesn't know how to route to a destination, certain port is unreachable, TTL of an IP datagram expired, etc.
The makeup of an ICMP packet:

Type (8 bits)
Code (8 bits)
Checksum (16 bits)
Rest of header (32 bit; optional)
Payload
ICMP is developed for automatic use by networked devices, but sometimes these messages are useful to human operators too. Ping is a specific tool for that (exists in every OS), it lets user send a special type of ICMP message called an echo request. If everything is working correctly, the destination will send back an echo reply. Most basic use: ping <IP or FQDN>.
xxxxxxxxxxuser@pc:~$ ping 1.1.1.1PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.64 bytes from 1.1.1.1: icmp_seq=1 ttl=53 time=55.7 ms64 bytes from 1.1.1.1: icmp_seq=2 ttl=53 time=47.3 ms64 bytes from 1.1.1.1: icmp_seq=3 ttl=53 time=53.7 ms64 bytes from 1.1.1.1: icmp_seq=4 ttl=53 time=47.4 ms^C--- 1.1.1.1 ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3005msrtt min/avg/max/mdev = 47.291/51.044/55.737/3.757 msping command will run until it's interrupted, and on Windows it sends four echo requests by defaultCommunications across networks go through lots of intermediary nodes, so there is a need for a way to determine where in the chain of router hops the problem occured. Traceroute utility is used for that. It lets user discover the path between two nodes, and gives the information about each hop along the way.
xxxxxxxxxxuser@pc:~$ traceroute coursera.orgtraceroute to coursera.org (143.204.55.14), 30 hops max, 60 byte packets 1 * * * 2 * * * 3 vlan301.as06.cph1.dk.m247.com (37.120.131.49) 35.330 ms 35.369 ms 35.357 ms 4 83.97.21.170 (83.97.21.170) 46.660 ms 46.657 ms 46.634 ms 5 xe-2-3-0-0.bb1.cph1.dk.m247.com (83.97.21.77) 34.967 ms 34.965 ms 34.604 ms...17 server-143-204-55-14.osl50.r.cloudfront.net (143.204.55.14) 44.709 ms 82.028 ms 81.902 mstraceroute works by sending to the destination a set of packets with different TTLs. These packets one by one will reach every router on the path to the destination, which will result in a series of ICMP Time Exceeded messages sent back to the source.traceroute will send three identical packets. Each line of the output: the number of the hop, IP of the device, and the round trip time for all three packets (you will also see a host name if traceroute can resolve it).traceroute sends UDP packets to very high port numbers. On Windows, the command has a shortened name tracert, and defaults to using ICMP echo requests.mtr on Linux and MacOS, and pathping on Windows.ICMP and traceroute help to test connectivity between machines at the network layer. To check if things work at the transport layer netcat (Linux and Mac OS) and Test-NetConnection (Windows) utilities are used.
netcat
nc <host> <port>netcat would try to establish a connection: if it fails, the command will exit, and if it succeeds, you'll see a blinking cursor, waiting for more input-z (zero input/output mode) and -v (verbose) parameters, then the output will simply tell if the connection to the port in question is possiblexxxxxxxxxxuser@pc:~$ nc -zv duckduckgo.com 80Connection to duckduckgo.com 80 port [tcp/http] succeeded!Test-NetConnection
Test-NetConnection <host>-port <N> option is usedxxxxxxxxxxPS C:\Users\user> Test-NetConnection -port 80 duckduckgo.comComputerName : duckduckgo.comRemoteAddress : 40.114.177.156RemotePort : 80InterfaceAlias : Local Area ConnectionSourceAddress : *.*.*.*TcpTestSucceeded : TrueThe most common name resolution tool is nslookup (available on all operating systems).
xxxxxxxxxxuser@pc:~$ nslookup github.comServer: * * * Address: * * *#53Non-authoritative answer:Name: github.comAddress: 140.82.118.4basic use: nslookup <host name>
the output displays what server was used to perform the request and the resolution result (i.e., A record is returned)
nsloolup also includes interactive mode that lets user set additional options and run lots of queries in a row (to start it enter nslookup without any parameters):
server <IP address> will make all the following name resolutions use specified servertype=<record type> will change the default resource record typeset debug will display full response packetsAn ISP almost always gives access to a recursive name server as a part of the service it provides. But most businesses also run their own DNS servers (to also resolve names of internal hosts). A third option is to use a DNS as a service provider, and it's getting more and more popular.
In any case it's helpful to have a way to test DNS functionality and also have a backup DNS option. That's where public DNS servers can help (name servers specifically set up by some Internet organization so that anyone can use them for free).
4.2.2.1 through 4.2.2.68.8.8.8 and 8.8.4.4Domain names need to be globally unique for a system to work. At the top level it's the responsibility of ICANN. But assignment of domain names to particular organizations and individuals is managed by registrars.
Long before DNS was established, it was clear that a language-based system for refering to network devices is needed. Host files were used for that (files that contain tables of network addresses and corresponding host names).
127.0.0.1 localhost for IPv4, and ::1 localhost for IPv6)Cloud computing is a technological approach where computing resources are provisioned to users in a shareable way. It is based on the concept of hardware virtualization.
Hardware virtualization
Cloud computing
The cloud takes the concept of hardware virtualization one step further. A big cluster of interconnected machines can function as hosts for lots of virtual guests and let share available resources among all of those instances. And companies that run these servers can provide their computing resources for other companies and individuals as a paid service.

instead of buying physical servers, clients pay for the cloud service (exactly for the amount of used computing resources)
servers maintenance is handled by cloud computing companies
easy to set up (through a web browser)
cloud computing companies also provide other services that can be outsourced (e.g., backup, load balancer)
types of cloud:
X as a service
The concept of the cloud could be described as IaaS (infrastructure as a service), which abstracts away the physical infrastructure. But cloud can also be understood in other ways:
PaaS (platform as a service)
SaaS (software as a service)
Cloud storage
Another popular way to use cloud technologies, which lets customers keep their data secure, accessible, and available.
By the mid 1990s, it was clear that the 4.2 billion IPv4 address space will be exhausted at some point. IPv6 was developed to resolve this issue (IPv5 was an experimental protocol that introduced the concept of connections, but it never saw wide adoption, and connection state was handled better later on by the transport layer and TCP).
IPv6 address is a 128 bit number written out as eight groups of 16 bits each, where each group is made up of four HEX digits (e.g., 2001:0db8:0000:0000:0000:8a2e:0370:7334)
often the shortened notation is used:
Examples:
2001:0db8:0000:0000:0000:8a2e:0370:7334 will be shortened as 2001:db8::8a2e:370:7334::1IPv6 address space have reserved ranges of addresses, e.g.,:
2001:0db8 has been reserved for documentation and educationFF00:: has been reserved for multicastFE80:: has been reserved for link-local unicast (allow for local network segment communications and are configured based upon a host's MAC address; used to receive network configurations)default partition of an IPv6 address into network ID and host ID is partition in halves, but subnetting and CIDR can be used too (usually for administrative purposes)
IPv6 datagram is an improved version of IPv4 datagram:

Version (4 bits)
Traffic class (8 bits)
Flow label (20 bits)
Payload length (16 bits)
Next header (8 bits)
Hop limit (8 bits)
Source and destination IP addresses (256 bits)
Additional header (optional)
Payload
It's not possible for the entire Internet to switch to IPv6 at once, so smooth transition approach is needed. IPv6 and IPv4 traffic need to coexist with each other during this transition period. Many different technologies, protocols and methods are used for this:
IPv4 mapped address space
192.168.1.1 will be mapped to 0:0:0:0:0:ffff:d1ad:35a7IPv6 tunnels